package com.zhp1.SpringBootAlibaba;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.core.env.Environment;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 类说明
 *
 * @author porridge
 * @version V1.0
 * @Title TempController
 * @Package com.zhp1.SpringBootAlibaba
 * @Date 2024/2/29 15:58
 */
@RefreshScope
@RestController
public class TempController {

    @Value("${hello.name:}")
    String name;
    @Autowired
    Environment env;

    @GetMapping(value = "/")
    public String echo() {
        return "Hello " +  name + "  " + env.getProperty("hello.name", "");
    }




}
